<!DOCTYPE HTML>
<html>
<head>
	<title>我的个人博客</title>
	<meta charset="utf8">
	<link rel="stylesheet" type="text/css" href="style.css">
	<link rel="icon" type="image/png" href="simbs.png">
</head>
<body>

<div class="top">
	<div class="header"> 
		<div class="logo">
			<a href='index.php'><img src="logo.png"></a>
		</div>
		<div id="container">
			<ul>
<?php
	//调用文件CatalogService.class.php
	require_once 'CatalogService.class.php';
	$catalogService = new CatalogService();
	echo $catalogService->navigation();
?>
			</ul>
		</div>
	</div>
	<div class="single">
<?php
	//如果收到blogAdd.php传送的id,则显示那个id的文章

	//接受id
	if(!empty($_GET['id'])){
		$id=$_GET['id'];
	}
	//调用配置文件BlogService.class.php
	require_once 'BlogService.class.php';
	
	$blogService = new BlogService();
	echo $blogService->viewBlog($id);	
?>

	</div>
	<div class="sidebar">
		<div class="loginSuccess">
			<?php
				session_start();
				if(!empty($_SESSION['name'])){
				echo "当前用户: ".$_SESSION['name']."<br />";
                                echo "<a href='blogList.php'>管理博文</a><br/>";
                                echo "<a href='blogAdd.php'>添加博文</a><br/>";
                                echo "<a href='configManage.php'>管理设置</a><br/>";
				echo "<a href='login.php'>重新登录</a>";
				} else{
				echo "<a href='login.php'>用户登录</a>";
				}
               		?>      
		</div>
		<div class="latest">最近更新
		<ul>
<?php
	//调用文件BlogService.php
	require_once 'BlogService.class.php';
	$blogService = new BlogService();
	echo $blogService->getLatestBlogTitle(10);
?>
		</ul>
		</div>
	</div>
	<div id="footer">
		<p>Copyright &#169;2012 Powered by <a href="http://code.google.com/p/simbs/">simbs</a> </p>
	</div>
</div>
</body>
</html>
